package com.slfx.data.permission.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * @Author: slfx
 * @Date: 2023-01-02
 * @Description:
 **/
@Data
public class CreateUserDataAuthReqDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("用户编码")
    @NotEmpty(message = "用户编码不能为空")
    private String userCode;

    @ApiModelProperty("数据编码")
    @NotEmpty(message = "数据编码不能为空")
    private String dataCode;

    @ApiModelProperty("明细列表")
    @NotNull
    private List<Item> itemList;

    @Data
    public static class Item implements Serializable {
        @ApiModelProperty("权限编码")
        @NotEmpty(message = "权限编码不能为空")
        private String authCode;

        @ApiModelProperty("用户编码")
        @NotEmpty(message = "用户编码不能为空")
        private String userCode;

        @ApiModelProperty("权限名称")
        @NotEmpty(message = "权限名称不能为空")
        private String authName;

        @ApiModelProperty("数据编码")
        @NotEmpty(message = "数据编码不能为空")
        private String dataCode;
    }

}
